is_all_succ=1
fail_list=()

if [ -z $1 ] 
then
	for each in `ls *.proto`
	do
		protoc --java_out=../common $each
		if [ $? -ne 0 ] 
		then
			is_all_succ=0
			fail_list=("${fail_list[@]}" $each)
		fi
	done	
else 
	protoc --java_out=../common $1
fi

if [ $is_all_succ -eq 1 ] 
then
	echo "all success"
else
	echo "failed : $fail_list"
fi

#protoc --java_out=../common ClientToBa
